//
//
#ifndef Plane3D_h__
#define Plane3D_h__

#include "Stdafx.h"
#include "Point3D.h"
#include "Vector3D.h"

namespace Geometric
{
	class Plane3D
	{
	public:
		// default constructor
		Plane3D(){}
		// destructor
		~Plane3D(){}

	public:
		double m_a;
		double m_b;
		double m_c;
		double m_d;

	public:
		// interfaces: if the geometric object is valid
		inline virtual bool isValid() = 0;
		// interfaces: translate the object
		inline virtual void translate(double _x, double _y) = 0;
		// interfaces: rotate the object(counterclockwise)
		inline virtual void rotate(double _angle) = 0;
		// interfaces: scale the object
		inline virtual void scale(double _x, double _y) = 0;

	public:
		inline void getVertical(Vector3D& _vec)
		{
			_vec.m_x = m_a;
			_vec.m_y = m_b;
			_vec.m_z = m_c;
		}

		inline bool isOnPlane(Point3D& _point)
		{
			return Gmath::isZero(m_a*_point.m_x + m_b*_point.m_y + m_c*_point.m_z + m_d);
		}
	};
}
#endif